package cn.zakrov.sbs004.controller;

import cn.zakrov.sbs004.config.MicroServiceUrl;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/test")
public class ConfigController {
    private static final Logger logger = LoggerFactory.getLogger(ConfigController.class);

    @Value("${url.orderUrl}")
    private String orderUrl;

    @Resource
    private MicroServiceUrl microServiceUrl;

    @RequestMapping("/config")
    public String testConfig() {
        logger.info("===orderUrl: {} ===", orderUrl);
        logger.info("===userUrl: {} ===", microServiceUrl.getUserUrl());
        logger.info("===shoppingUrl: {} ===", microServiceUrl.getShoppingUrl());
        return "success";
    }
}
